Exercise:1
- Write a code in which the sprite will ask the user to enter a number. The program will then check if the number is a prime number or not and display the result.
See the video for your reference.
Exercise:2
- Write a scratch code in which the computer selects a random number between some boundaries in its memory and the user has to find the number. Here you have only 5 chances to guess the number. The program will stop if the correct answer is guessed or if the number of guesses is exceeded. Another variant of this is, when you make a guess the computer will tell you whether the answer is above your guess or below your guess.
See the video for your reference.
Exercise:3
- Use the repeat until block to make the first exercise without any limitation.
See the video for your reference.
Solutions
Click here to view the sb3 file to complete exercise-1. (Solution).
Click here to view the sb3 file to complete exercise-2. (Solution).
Click here to view the sb3 file to complete exercise-3. (Solution).